<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录界面</title>
    <link rel="stylesheet" href="./lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="./lib/bootstrap-validator/css/bootstrapValidator.css">
    <link rel="stylesheet" href="./lib/nprogress/nprogress.css">
    <link rel="stylesheet" href="./css/common.css">

    <style>
    </style>
</head>

<body>
    <!--左边区域 -->
    <div class="lt-indx-l indx-transit">
        <h3>黑马商城</h3>
        <div class="default">
            <img src="./images/default.png" alt="">
            <p>超级管理员</p>
        </div>
        <ul class="indx-val">
            <li><a href="./user.html"> <i class="glyphicon glyphicon-user"></i>用户管理</a></li>
            <li class="classify">
                <a href="#"><i class="glyphicon glyphicon-list"></i>分类管理</a>
                <ul class="dsp-no">
                    <li><a href="./one.html">一级分类</a></li>
                    <li><a href="./tow.html">二级分类</a></li>
                </ul>
            </li>
            <li class="indx-current"><a href="./product.html"><i class="glyphicon glyphicon-gift"></i>商品管理</a></li>
        </ul>
    </div>
    <!-- 右边内容区域 -->
    <div class="lt-indx-r pd-180 indx-transit">
        <!-- 顶部区域 -->
        <div class="tp-conten pd-180 indx-transit">
            <a href="#" class="icon-menu pull-left"><i class="glyphicon glyphicon-menu-hamburger"></i></a>
            <a href="#" class="icon-logout pull-right"><i class="glyphicon glyphicon-log-out"></i></a>
        </div>
        <!-- 下面的内容 -->
        <div class="content-but pd-15">
            <!-- bootstrap插件 路径导航  -->
            <ol class="breadcrumb">
                <li><a href="./index.html">管理系统</a></li>
                <li class="active">商品管理</li>
            </ol>


            <!-- 添加商品 -->
            <div>
                <button class="btn btn-default" data-toggle="modal" data-target="#myModal">添加商品</button>
            </div>

            <!-- 表格 -->
            <table class="table table-bordered table-hover text-center mt-20">
                <thead>
                    <th>序号</th>
                    <th>商品名称</th>
                    <th>商品描述</th>
                    <th>商品库存</th>
                    <th>商品尺寸</th>
                    <th>商品状态</th>
                    <th>操作</th>
                </thead>
                <tbody>
                    <tr>
                        <td>序号</td>
                        <td>商品名称</td>
                        <td>商品描述</td>
                        <td>商品库存</td>
                        <td>商品尺寸</td>
                        <td>商品状态</td>
                        <td>操作</td>
                    </tr>
                </tbody>
            </table>

            <!-- 分页 -->
            <div class="pull-right">
                <ul id="paginator"></ul>
            </div>
        </div>
    </div>


    <!-- 模态框 -->
    <div class="modal fade pro-modal" tabindex="-1" role="dialog" id="myModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">添加商品</h4>
                </div>
                <div class="modal-body">
                    <form class="add-form" id="form1">
                        <!-- 下拉框 -->
                        <div class="form-group">
                            <div class="dropdown">
                                <button class="btn btn-default dropdown-toggle pro-btn" type="button" id="dropdownMenu1"
                                    data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                                    请选择二级分类
                                    <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu por-tow" aria-labelledby="dropdownMenu1">
                                    <li><a href="#">Action</a></li>
                                </ul>
                            </div>
                            <!-- 隐藏域  用存储 二级分类的 id -->
                            <div>
                                <input type="hidden" name="brandId" class="brandId">
                            </div>
                        </div>

                        <!-- 商品名称 -->
                        <div class="form-group">
                            <input type="text" class="form-control proName" name="proName" placeholder="请输入产品名称">
                        </div>
                        <!-- 商品描述 -->
                        <div class="form-group">
                            <textarea name="proDesc" class="form-control proDesc" cols="30" rows="4"
                                placeholder="请输入商品描述"></textarea>
                        </div>
                        <!-- 商品库存 -->
                        <div class="form-group">
                            <input type="text" class="form-control num" name="num" placeholder="请输入产品库存">
                        </div>
                        <!-- 商品尺码 -->
                        <div class="form-group">
                            <input type="text" class="form-control size" name="size" placeholder="请输入产品尺寸">
                        </div>
                        <!-- 商品原价-->
                        <div class="form-group">
                            <input type="text" class="form-control oldPrice" name="oldPrice" placeholder="请输入产品原价">
                        </div>
                        <!-- 商品现价 -->
                        <div class="form-group">
                            <input type="text" class="form-control price" name="price" placeholder="请输入产品价格">
                        </div>


                        <!--上传图片-->
                        <div class="form-group">
                            <label for="picArr" class="btn btn-default">上传文件</label>
                            <input id="picArr" type="file" name="pic1" data-url="/product/addProductPic" class="hide"
                                multiple>

                            <div class="box-img">

                            </div>
                            <!-- 隐藏域 用来存储 图片路径 -->
                            <div>
                                <input type="hidden" name="picArr" class="picArr">
                            </div>

                        </div>

                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary pro-sub" form="form1">添加</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->

    <!-- 模板引擎 -->
    <script type="text/html" id="tmp">
       {{each rows v i}}
       <tr>
        <td>{{(page-1)*size+i+1}}</td>
        <td>{{v.proName}}</td>
        <td>{{v.proDesc}}</td>
        <td>{{v.num}}</td>
        <td>{{v.size}}</td>
        <td>{{v.statu== 1 ? '已上架':'已下架'}}</td>
        <td>
            {{if(v.statu==1)}}
             <button class="btn btn-danger">下架</button>   
            {{else}}
             <button class="btn btn-primary">上架</button> 
            {{/if}}
        </td>
    </tr>
       {{/each}}
    </script>

    <!-- 下拉框模板引擎 -->
    <script type="text/html" id="tmp1">
        {{each rows v i}}
          <li><a href="#" data-id="{{v.id}}">{{v.brandName}}</a></li>
        {{/each}}
    </script>

    <script src="./lib/jquery/jquery.js"></script>
    <script src="./lib/bootstrap/js/bootstrap.js"></script>
    <script src="./lib/bootstrap-validator/js/bootstrapValidator.js"></script>
    <script src="./lib/nprogress/nprogress.js"></script>
    <script src="./lib/artTemplate/template-web.js"></script>
    <script src="./lib/bootstrap-paginator/bootstrap-paginator.min.js"></script>
    <script src="./lib/jquery-fileupload/jquery.ui.widget.js"></script>
    <script src="./lib/jquery-fileupload/jquery.iframe-transport.js"></script>
    <script src="./lib/jquery-fileupload/jquery.fileupload.js"></script>
    <script src="./js/common.js"></script>
    <script src="./js/product.js"></script>
</body>

</html>